//权限管理下的角色管理模块
const express = require('express')
const router = express.Router()
const menu_handler = require('../router_handler/menu')
//导入验证表单数据的中间件
const validator = require('../util/validator')
//引入校验规则
const { add_update_schema } = require('../schema/menu')

//获取所有菜单信息
router.get('/getAllMenus',menu_handler.getAllMenus)
//添加菜单
router.post('/addMenu', validator.body(add_update_schema), menu_handler.addMenu)
//修改菜单
router.post('/updateMenu', validator.body(add_update_schema), menu_handler.updateMenu)
//删除菜单
router.post('/deleteMenu',menu_handler.deleteMenu)

module.exports = router
